<div class="main-title">
    <h1 class="float-left">Roles and Permissions</h1>
    <span class="controls">
        <a id="addUser" class="link-button with-icon" href="<?php echo $this->createUrl('roles/create'); ?>">
            <img src="/images/icons/fugue/plus.png" />
            Add Role
        </a>
    </span>
</div>
<div class="grid_16">
	<?php
	$this->widget('PsGridView', array(
		'id' => 'admin-roles-grid',
		'dataProvider' => $dataProvider,
		'template' => '{pager}{pagesize}{items}',
		'pagerCssClass' => 'pager float-right',
		'pagesizeCssClass' => 'pager-pagesize',
		'htmlOptions' => array(
			'class' => 'grid-view no-shadow'
		),
		'columns' => array(
			'description' => array(
				'header' => 'Role',
				'name' => 'description',
				'type' => 'raw',
				'value' => 'CHtml::link($data->description, array("roles/view", "role_id" => $data->name), array("class" => "blue link"))'
			),
			'actions' => array(
				'class' => 'CButtonColumn',
				'template' => '{view}{update}{delete}{copy}',
				'buttons' => array(
					'view' => array(
						'label' => 'View',
						'url' => 'Yii::app()->createUrl("admin/roles/view", array("role_id"=>$data->name))'
					),
					'update' => array(
						'label' => 'update',
						'url' => 'Yii::app()->createUrl("admin/roles/update", array("role_id"=>$data->name))',
						'visible' => '$data->agency_id !== NULL'
					),
					'delete' => array(
						'label' => 'delete',
						'url' => 'Yii::app()->createUrl("admin/roles/delete", array("role_id"=>$data->name))',
						'visible' => '$data->agency_id !== NULL'
					),
					'copy' => array(
						'label' => 'Copy',
						'url' => 'Yii::app()->createUrl("admin/roles/create", array("role_id"=>$data->name))'
					),
				),
				'htmlOptions' => array(
					'width' => 120
				),
			)
		)
	));
	?>
</div>
